package com.excelOperation.service.imp;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.excelOperation.dao.ExcelOperationDao;
import com.excelOperation.service.ExcelOperationService;
import com.excelOperation.vo.ExcelVo;


@Service("excelOperationServiceImp") 
public class ExcelOperationServiceImp implements ExcelOperationService {

	@Autowired
	private ExcelOperationDao excelOperationDao;
	
	
	//插入记录
	@Override
	public String insertExcelInfo(List<ExcelVo> excelList) {
		excelOperationDao.insertExcelInfo(excelList);
		return "s";
	}

	//查询所有人员
	@Override
	public Map<String, String> selUserInfo(){
		Map<String, String> UserInfo =new HashMap<String, String>();
		//把list转换成map
		List<String> UserInfoList=excelOperationDao.selUserInfo();
		for (String string : UserInfoList) {
			UserInfo.put(string.split("=")[0], string.split("=")[1]);
		}	
		return 	UserInfo;					
	}
	
	//抽取周报表的数据
    public List<String> selAssociationInfo(Integer year,Integer month){
    	return excelOperationDao.selAssociationInfo(year,month);
    }

	
  //查询人员表对应表信息
    @Override
	public List<ExcelVo> selUserAssociationfo() {		
		return excelOperationDao.selUserAssociationfo();
	}
	
	
	

}
